package com.micro.school.system.api.factory;

import com.micro.school.common.core.domain.R;
import com.micro.school.system.api.RemoteEduService;
import com.micro.school.system.api.domain.vo.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 日志服务降级处理
 *
 * @author upupgo
 */
@Component
public class RemoteEduFallbackFactory implements FallbackFactory<RemoteEduService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteEduFallbackFactory.class);

    @Override
    public RemoteEduService create(Throwable cause) {
        log.error("用户服务调用失败:{}", cause.getMessage());
        return new RemoteEduService() {
            @Override
            public R<List<SchoolCollegeVos>> checkCollege(SchoolCollegeVos schoolCollegeVos) {
                return null;
            }

            @Override
            public R<String> getAllCollegeNameList(SchoolCollegeVos schoolCollegeVos) {
                return null;
            }

            @Override
            public R<List<CollegeModelVos>> checkEducation(CollegeModelVos collegeModelVos) {
                return null;
            }

            @Override
            public R<List<SchoolGradeVos>> checkGrade(SchoolGradeVos schoolGradeVos) {
                return null;
            }

            @Override
            public R<List<CollegeMajorVos>> checkMajor(CollegeMajorVos collegeMajorVos) {
                return null;
            }

            @Override
            public R<List<SchoolCampusVos>> checkCampus(SchoolCampusVos schoolCampusVos) {
                return null;
            }

            @Override
            public R<List<SchoolFeeYearVos>> checkFeeYear(SchoolFeeYearVos schoolFeeYearVos) {
                return null;
            }

            @Override
            public R<CollegeMajorVos> getMajorById(Long id) {
                return null;
            }

            @Override
            public R<CollegeModelVos> getModelById(Long id) {
                return null;
            }

            @Override
            public R<SchoolCampusVos> getCampusById(Long id) {
                return null;
            }

            @Override
            public R<SchoolCollegeVos> getCollegeById(Long id) {
                return null;
            }

            @Override
            public R<SchoolFeeYearVos> getYearById(Long id) {
                return null;
            }

            @Override
            public R<SchoolGradeVos> getGradeById(Long id) {
                return null;
            }

            @Override
            public R<String> getAllCampusIdVos(SchoolCampusVos schoolCampusVos) {
                return null;
            }
        };
    }
}
